:: DEPENDENCIES
:: If ..\WinRAR\rar.exe does not exits, then "rar.exe" must be on the path
:: If ..\svn\svs.exe does not exits, then "svn.exe" must be on the path


@echo off
setlocal
    (set DST=%~dp0..)
    (set PTH=/trunk/make-hop/hop)
    (set URL=http://whqrgursversbk.googlecode.com/svn)
    (set SRC=%URL%%PTH%)
    (set NAME=hop)
    (set EXP=%NAME%)
    (set COMMENTS=%EXP%\comments\comments.txt)
    (set XXX=%NAME%.exe)
    (set RRR=%NAME%.rar)
    del %XXX%
    del %RRR%

    setlocal
        set path=%~dp0..\WinRAR;%path%
        set path=%~dp0..\svn;%path%
        svn export %SRC%/root %EXP%\root 
        svn export %SRC%/comments %EXP%\comments 
        rar a -r -ep1 %EXP% %EXP%\root\*.*
        rar s %NAME%
        rar c -z%COMMENTS%   %XXX%
    endlocal
    del %RRR%
    move %XXX% %DST%
    %DST%\%XXX%
   

endlocal
pause
